package com.ma.server.Impl;

import com.baomidou.mybatisplus.annotation.TableField;
import com.ma.Dao.FilesDao;
import com.ma.entity.Files;
import com.ma.server.FilesServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ProjectName: project
 * @Package: com.ma.server.Impl
 * @ClassName: FilesServerImpl
 * @Author: YHHHH
 * @Description:
 * @Date: 2021/3/31 16:05
 * @Version: 1.0
 */
@Service
@Transactional
public class FilesServerImpl implements FilesServer {
    @Autowired
    private FilesDao filesDao;

    @Override
    public List<Files> findByNumber(String number) {
        List<Files> byNumber = filesDao.findByNumber(number);
        return byNumber;
    }

    @Override
    public Integer addFiles(Files files) {
        Integer integer = filesDao.addFiles(files);

        return integer;
    }

    @Override
    public Files findById(Integer id) {

        Files byId = filesDao.findById(id);
        return byId;

    }

    @Override
    public Integer updateDownTime(Integer id) {

        Integer integer = filesDao.updateDownLoad(id);
        return integer;
    }

    @Override
    public Integer removeFiles(Integer id) {
        Integer integer = filesDao.removeFiles(id);
        return integer;
    }

    @Override
    public List<Files> findTeamFiles(Integer id) {

        List<Files> teamFiles = filesDao.findTeamFiles(id);
        return  teamFiles;

    }

    @Override
    public Integer deleteStudentFiles(String number) {
        Integer integer = filesDao.deleteStudentFiles(number);
        return integer;

    }

    @Override
    public Integer deleteTeamFiles(Integer id) {
        Integer integer = filesDao.deleteTeamFiles(id);
        return integer;

    }
}
